package com.collect.tanzania.zhiScene.zhiCollection.zhiGroup.zhiPerformance.zhiSort;

import com.collect.tanzania.zhiBean.zhiReceive.ZHIRPerfermanceGroupHistoryEntity;
import com.collect.tanzania.zhiUtils.ZHICalendarUtil;

import java.util.Comparator;

public class ZHIGroupHistoryCompareByDateASC implements Comparator<ZHIRPerfermanceGroupHistoryEntity> {
    @Override
    public int compare(ZHIRPerfermanceGroupHistoryEntity o1, ZHIRPerfermanceGroupHistoryEntity o2) {

        long o1DateL = ZHICalendarUtil.getTimeFromDateString(o1.getMonthDate()+"-01 00:00:00", null);
        long o2DateL = ZHICalendarUtil.getTimeFromDateString(o2.getMonthDate()+"-01 00:00:00", null);

        return Long.compare(o2DateL, o1DateL);
    }
}
